<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> 
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib prefix="security" uri="http://www.springframework.org/security/tags"%>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Bootstrap 3, from LayoutIt!</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="description" content="">
  <meta name="author" content="">

	<!--link rel="stylesheet/less" href="less/bootstrap.less" type="text/css" /-->
	<!--link rel="stylesheet/less" href="less/responsive.less" type="text/css" /-->
	<!--script src="js/less-1.3.3.min.js"></script-->
	<!--append ‘#!watch’ to the browser URL, then refresh the page. -->
	
	<link href="css/bootstrap.min.css" rel="stylesheet">
	<link href="css/style.css" rel="stylesheet">

  <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
  <!--[if lt IE 9]>
    <script src="js/html5shiv.js"></script>
  <![endif]-->

  <!-- Fav and touch icons -->
  <link rel="apple-touch-icon-precomposed" sizes="144x144" href="img/apple-touch-icon-144-precomposed.png">
  <link rel="apple-touch-icon-precomposed" sizes="114x114" href="img/apple-touch-icon-114-precomposed.png">
  <link rel="apple-touch-icon-precomposed" sizes="72x72" href="img/apple-touch-icon-72-precomposed.png">
  <link rel="apple-touch-icon-precomposed" href="img/apple-touch-icon-57-precomposed.png">
  <link rel="shortcut icon" href="img/favicon.png">
  
	<script type="text/javascript" src="js/jquery.min.js"></script>
	<script type="text/javascript" src="js/bootstrap.min.js"></script>
	<script type="text/javascript" src="js/scripts.js"></script>
</head>

<body>
<div class="container">
	<div class="row clearfix">
    	<jsp:include page="../nav.jsp"></jsp:include>
		<div class="col-md-12 column">
			<h3>
				物品陈列表
			</h3>
		</div>
	</div>
	 <div class="collapse navbar-collapse" id="">
	 <form class="navbar-form navbar-right" role="search" action="addGoods.html">
    <div class="form-group">
					<div class="col-xs-4">
						<input type="text" class="form-control" name="code" value="${user.code}" style="display:none;">
					</div>
				</div>
      <button type="submit" class="btn btn-default" >添加</button>
    </form>
    </div>
	<div class="row clearfix">
		<div class="col-md-12 column">
			<table class="table table-bordered table-hover">
				<thead>
					<tr>
						<th>
							序号
						</th>
						<th>
							照片
						</th>
						<th>
							物品名称
						</th>
						<th>
							状况
						</th>
                        <th>
							操作
						</th>
					</tr>
				</thead>
				<tbody>
				<c:forEach items="${goodsList.pageItems}" var="goods">
					<tr>
						<td>
							${goods.goodsId}
						</td>
						<td width="100" height="50">
							<a href="goods.html?goodsId=${goods.goodsId}&code=${user.code}" class="thumbnail">
							<c:choose>
							<c:when test="${empty goods.images}">
								<img data-src="holder.js/100%x170" alt="..." src="http://lorempixel.com/140/140/">
							</c:when>
							<c:otherwise>
							<img data-src="holder.js/100%x170" alt="..." src="img/upload/${goods.images[0].url}">
								
							</c:otherwise>
							</c:choose>
                            </a>
						</td>
						<td>
							${goods.goodsName}
						</td>
						<td>
							Default
						</td>
                        <td>
							<a href="updateGoods.action?code=${user.code}&goosId=${goods.goodsId}">修改</a>|<a href="deleteGoods.action?code=${user.code}&goosId=${goods.goodsId}">删除</a>
						</td>
					</tr>
				</c:forEach>	
				</tbody>
			</table>
			<ul class="pagination clearfix">
				<li class="<c:if test='${goodsList.pageNumber == 1}'>disabled</c:if>">
					<a href="goodsList.html?code=${user.code}&pageNumber=${goodsList.pageNumber-1}" >Prev</a>
				</li>
			
				<c:forEach begin="1" end="${goodsList.pagesAvailable}" var="page">
				<li class="<c:if test='${goodsList.pageNumber == page}'>active</c:if>">
					<a href="goodsList.html?code=${user.code}&pageNumber=${page}">${page}</a>
				</li>
				</c:forEach>
				<li class="<c:if test='${goodsList.pageNumber == goodsList.pagesAvailable}'>disabled</c:if>">
					<a href="goodsList.html?code=${user.code}&pageNumber=${goodsList.pageNumber+1}">Next</a>
				</li>
				
			</ul>
		</div>
	</div>
   <jsp:include page="../foot.jsp"></jsp:include>
</div>
</body>
</html>
